﻿using Microsoft.AspNetCore.Mvc;
using SX.BaseService.API.Base;
using SX.BaseService.Service.Implement.Microservice.ViewModel;
using SX.BaseService.Service.Interface;
using SX.Core;
using SX.ServiceDiscovery.Abstractions;
using System.ComponentModel;
using System.Threading.Tasks;

namespace SX.BaseService.API.Controllers
{

    [Description("网关路由配置")]
    [Menu]
    public class ApiGateWayRerouteController : BaseController
    {
        private readonly IMicroService _service;
        private readonly IServiceDiscovery _serviceDiscovery;
        public ApiGateWayRerouteController(IMicroService service, IServiceDiscovery serviceDiscovery )
        {
            _service = service;
            _serviceDiscovery = serviceDiscovery;
        }

        [HttpGet]
        [Description("查询网关路由列表")]
        public async Task<IApiResult> QueryApiGatewayReRouteList([FromQuery] GatewayReRouteQueryModel input)
        {
            return await _service.QueryApiGatewayReRouteList(input);
        }
    
        [HttpPost]
        [Description("新增网关路由")]
        public async Task<IApiResult> AddApiGatewayReRoute([FromBody] GatewayReRouteAddModel input)
        {
            return await _service.AddApiGatewayReRoute(input);
        }

    }
}
